export default {
    namespaced: true,
    state: {
        isShow: false,
        toastMsg: '默认提示',
        //success成功,danger失败,warning警告
        toastType: 'danger'
    },
    mutations: {
        changeshowToast(state, payload) {
            state.isShow = payload.isshow
            if (payload.isshow) {
                state.toastMsg = payload.msg
                state.toastType = payload.type
            }

        },
    },
    actions: {
        
        asyncIsshow({ commit }, payload) {
            commit("changeshowToast", payload)
            setTimeout(() => {
                commit("changeshowToast", {
                    isshow: false
                })
            },3000)
        }
    }
}